﻿<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Manage.aspx.cs" Inherits="Account_Manager" %>

<%@ Register TagPrefix="ln" Namespace="Web.UI.CustomControls" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .failureNotification li 
        {
            padding-bottom: 10px;
            list-style-type: circle; /* Or can just use list-style: none; */
            
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div>
        <h2>
            Create a New Account
        </h2>
        <p>
            Use the form below to create a new account.
        </p>
        <p>
            Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
        </p>
        <span class="failureNotification">
            <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
        </span>
        <div class="accountInfo">
            <fieldset class="register">
                <legend>Account Information</legend>
                <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" ValidationGroup="RegisterUserValidationGroup"/>
                <div class="success" ID="registerMessage" runat="server" visible="false"></div>
                <div class="control-group">
                    <asp:Label ID="lblUserName" CssClass="control-label" runat="server" AssociatedControlID="txtUserName">User Name:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtUserName" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtUserName" 
                                CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lblFirstName" CssClass="control-label" runat="server" AssociatedControlID="txtFirstName">First Name:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" ControlToValidate="txtFirstName" 
                                CssClass="failureNotification" ErrorMessage="First Name is required." ToolTip="First Name is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lblLastName" CssClass="control-label" runat="server" AssociatedControlID="txtLastName">Last Name:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtLastName" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="LastNameRequired" runat="server" ControlToValidate="txtLastName" 
                                CssClass="failureNotification" ErrorMessage="Last Name is required." ToolTip="Last Name is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lbl" CssClass="control-label" runat="server" AssociatedControlID="txtFirstName">Email Address:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtEmailAddress" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="EmailAddressRequired" runat="server" ControlToValidate="txtEmailAddress" 
                                CssClass="failureNotification" ErrorMessage="Email Address is required" ToolTip="Email Address is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lblPassword" CssClass="control-label" runat="server" AssociatedControlID="txtPassword">Password:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtPassword" TextMode="password" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="txtPassword" 
                                CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lblConfirmPassword" CssClass="control-label" runat="server" AssociatedControlID="txtConfirmPassword">Confirm Password:</asp:Label>
                    <div class="controls">
                        <asp:TextBox ID="txtConfirmPassword" TextMode="password"  runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="txtConfirmPassword" 
                                CssClass="failureNotification" ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="ConfirmPasswordCompare" runat="server" ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword" 
                                CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
                    </div>
                </div>

                <div class="control-group">
                    <asp:Label ID="lblRoles" CssClass="control-label" runat="server" AssociatedControlID="ddlRoles">Role:</asp:Label>
                    <div class="controls">
                        <ln:RoleDropDownList ID="ddlRoles" runat="server" CssClass="textEntry"></ln:RoleDropDownList>
                        <asp:RequiredFieldValidator ID="RoleRequired" runat="server" ControlToValidate="ddlRoles" 
                                CssClass="failureNotification" ErrorMessage="Role is required." ToolTip="Role is required." 
                                ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </div>
                </div>

                <div class="control-actons">
                    <asp:Button ID="btnRegister" CssClass="btn btn-primary" runat="server" onclick="btnRegister_Click" CommandName="Register" Text="Create User" CausesValidation="true" ValidationGroup="RegisterUserValidationGroup"/>
                </div>
            </fieldset>
        </div>
    </div>
</asp:Content>